package com.dq.mapper;

import com.dq.entity.QQUser;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * @Author: Dang Qi
 * @Date: 2021/5/9 9:16
 * @Description:
 */
public interface QQUserMapper {

    @Insert("insert into qq_user(qq_number, nickName, gender, birthday, country, province, city) " +
            "values(#{qqNumber}, #{nickName}, #{gender}, #{birthday}, #{country}, #{province},#{city})")
    int insert(QQUser qqUser);

    @Select("select * from qq_user")
    List<QQUser> selectAll();

    @Select("select * from qq_user where qq_number=#{qqNumber}")
    QQUser selectByNo(String qqNumber);

    @Delete("delete from qq_user where qq_number=#{qqNumber}")
    int deleteByNo(String qqNumber);

    @Insert("update qq_user set nick_name=#{nickName},gender=#{gender},birthday=#{birthday},country=#{country}" +
            ",province=#{province},city=#{city} where qq_number=#{qqNumber}")
    int update(QQUser qqUser);
}
